//
//  ViewController.swift
//  TestCycleScrollView
//
//  Created by alyadan on 2017/3/11.
//  Copyright © 2017年 alyadan. All rights reserved.
//

import UIKit
import YDCycleScrollView
import SnapKit

class CycleScrollController: UIViewController {
    
    var cycleScrollModel: YDCanCycleScrollViewModel!
    
    lazy var cycleScrollView:YDCanCycleScrollView = YDCanCycleScrollView(viewModel: self.cycleScrollModel)

    
    override func viewDidLoad() {
        super.viewDidLoad()
//        let v1 = UIView()
//        v1.backgroundColor = UIColor.gray
//        let v2 = UIView()
//        v2.backgroundColor = UIColor.green
        
//        let views = [v1]
        
        self.cycleScrollModel = YDCanCycleScrollViewModel(parentViewModel: nil, getContentviewsBlock: { (index) -> UIView in
            let x = UIView()
            x.backgroundColor = UIColor.red
            return x
        }, viewCount: 2)
        
        self.cycleScrollModel.showPageController = true
        
        self.cycleScrollModel.timerInterval = 3
        
        
        
        self.automaticallyAdjustsScrollViewInsets = false
        self.cycleScrollView.frame = CGRect(x: 0, y: 64, width: 375, height: 600)
        
        self.view.addSubview(self.cycleScrollView)
        // Do any additional setup after loading the view, typically from a nib.
    }
    
//    override func updateViewConstraints() {
//        super.updateViewConstraints()
//        self.cycleScrollView.snp.updateConstraints { (ConstraintMaker) in
//            ConstraintMaker.edges.equalTo(UIEdgeInsets.zero)
//        }
//    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
}



